<?php
  $yhendus=new mysqli("localhost", "if13", "ifikad", "if13_alisiko1_k");

?>
<!doctype html>
<html>
  <head>
    <title>Kuulutused</title>
    <style type="text/css">
       #menyykiht{
         float: left;
         padding-right: 30px;
       }
       #sisukiht{
         float:left;
       }
       #jalusekiht{
         clear: left;
       }
    </style>
  </head>
  <body>
    <div id="menyykiht">
        <h2>Etteasted</h2>
        <ul>
          <?php
            $kask=$yhendus->prepare("SELECT etteaste, aeg FROM yritus ORDER BY aeg");
            $kask->bind_result($etteaste, $aeg);
            $kask->execute();
             while($kask->fetch()){
               echo "<li>".htmlspecialchars($etteaste).' '.$aeg."</li>";
             }
          ?>
        </ul>
        
    </div>
    <div id="jalusekiht">
       Lehe tegi Erik ja Ain
    </div>
  </body>
</html>
<?php
  $yhendus->close();
?>